import request from '../utils/request.js'

export function featchEventList(query) {
    return request({
        url: '/bms/alerts/list/',
        method: 'get',
        params: query
    })
}

// 标记为已读
export function updateWarnEvent(id, data) {
    return request({
        url: `/bms/alerts/${id}/`,
        method: 'patch',
        data
    })
}

// 全部标记为已读
export function updateAllWarnEvent() {
    return request({
        url: `/bms/alerts/readall/`,
        method: 'post'
    })
}

// 获取历史数据的项目类型
export function featchDevType(query) {
    return request({
        url: '/analysis-mang/analysis-item/types/',
        method: 'get',
        params: query
    })
}



// 查询传感器VBL11历史波形分析数据总览

export function featchVBLView(query) {
    return request({
        url: '/analysis-mang/vbl11/history/',
        method: 'get',
        params: query
    })
}
// 查询传感器分析项目详细数据类型
export function featchHisDetailType(query) {
    return request({
        url: '/analysis-mang/analysis-item/detail/types/',
        method: 'get',
        params: query
    })
}

// 获取历史数据分析详情
export function featchHistoryADetail(query) {
    return request({
        url: '/analysis-mang/analysis-item/detail/datas/',
        method: 'get',
        params: query
    })
}

// 获取历史数据分析详情
export function getMsgList(query) {
    return request({
        url: '/bms/message/list/',
        method: 'get',
        params: query
    })
}

// 消息一条信息标记为已读
export function addRead(id, data) {
    return request({
        url: `/bms/message/list/read/${id}/`,
        method: 'post',
        data
    })
}

// 消息一条信息标记为已读
export function addReadAll(data) {
    return request({
        url: `/bms/message/list/readall/`,
        method: 'post',
        data
    })
}

// 获取机器警报事件记录
export function getEquipAlarmList(query) {
    return request({
        url: '/bms/alerts/equip/list/',
        method: 'get',
        params: query
    })
}